import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/pages/Index'
import Nav from '@/components/Nav'
import NavDetail from '@/components/NavDetail'
import Login from '@/components/Login'
import Admin from '@/components/Admin'



Vue.use(Router)

export default new Router({
    base: '/front-end-nav-website/',
    routes: [{
            path: '/',
            redirect: '/nav',
            name: 'Index',
            component: Index,
            children: [{
                    path: '/nav',
                    name: 'Nav',
                    component: Nav
                },
                {
                    path: '/nav/:tagId',
                    name: 'NavDetail',
                    component: NavDetail
                }
            ]
        },
        {
            path: '/login',
            name: 'Login',
            component: Login
        },
        {
            path: '/admin',
            name: 'Admin',
            component: Admin,
            beforeEnter: (to, from, next) => {
                console.log(this);
            }
        },
        {
            path: '*',
            redirect: '/nav'
        }
    ]
})